<?php

class Workset_Configurator {

    static function init($caller, $options) {
        if ($options instanceof Zend_Config) {
            $options = $options->toArray();
        }

        foreach ($options as $key => $spec) {
            $key = self::_formatName($key);
            if (is_callable(array($caller, $key))) {
                $caller->$key($spec);
            }
        }
    }

    protected static function _formatName($name) {
        return 'set'.ucfirst($name);
    }

}

?>